<?php
/*Problem Domain
To Test the Session class access object
*/
include_once '../SessionDAOImpl.php';
include_once '../../model/TrainingSession.php';

class TestSessionDAOImpl extends PHPUnit_Framework_TestCase
{
	public function testSessionDAOImplObject()
	{
		$dbobj = new SessionDAOImpl();
		$sess1 = new TrainingSession("phpsession", "ketul", date("2015-02-08 11:14:15.638276"), TrainingSession::AVAILABLE, 							"arrays,functions", null, 1);

		$dbobj->saveOrUpdate($sess1);

		$arr = $dbobj->listSessions();
		$lst = $arr->getArrayList();
		$this->assertEquals('phpsession' , $lst[0]->getSessionName());
		$this->assertEquals('2015-02-08', date('Y-m-d', $lst[0]->getStartDateTime()));
	}
}
?>
